package gameClass;

import globals.Global;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;

import javax.imageio.ImageIO;

/**
 * @author Ben Elliott
 *
 */
public class TileMap implements Serializable {
	
	private class MapRow {
		public List<Tile> Col = new ArrayList<Tile>();
	}
	private List<MapRow> Row;
	
	public TileMap(int width, int height) {
		
		
		Row = new ArrayList<MapRow>();
		
		for (int row = 0; row < height; row++) {
			Row.add(new MapRow());
			for (int col = 0; col < width; col++){
				Tile grass = new Tile(0);
				Row.get(row).Col.add(grass);
			}
		}
	}
	
	public int getNumTilesX() {
		if (Row.size() > 0)
			return Row.get(0).Col.size();
		return 0;
	}
	
	public int getNumTilesY() {
		return Row.size();
	}
	
	public void loadMap(File f) {
		// Populate the tiles from the file
	}
	
	public Tile getTile(int x, int y) {
		return Row.get(y).Col.get(x);
	}
}
